id: 38245550845
1L | 作者:zqh——123 | 发布于 2013-08-31 13:48
我实在不知道出了什么问题:
Private Sub cmdAnniu_Click()
Dim strQian11wei As String
Dim strR As String, intR As Integer
Dim strD As String, intD As Integer, intD2 As Integer
Dim intDchange As Integer
Dim intDN As Integer
Dim strV As String
Dim strOutput As String
intDN = Val(InputBox("请问你的摆锤把有多长?", "请输入弧度(单位:格)"))
For int1 = 1 To (Len(txtInput.Text) + 2) \ 22
strQian11wei = Mid(txtInput.Text, ((int1 - 1) * 22) + 1, 11)
strR = Mid(txtInput.Text, ((int1 - 1) * 22) + 12, 3)
strD = Mid(txtInput.Text, ((int1 - 1) * 22) + 15, 3)
strV = Mid(txtInput.Text, ((int1 - 1) * 22) + 18, 3)
intR = CInt(strR)
intD = CInt(strD)
intD2 = CInt(strD)
RRR = CInt(strR) \ 32
Do
Select Case intR
Case Is < 10
strOutput = strOutput & strQian11wei & "00" & CStr(intR) & strD & strV & Chr(13) & Chr(10)
Case Is < 100
strOutput = strOutput & strQian11wei & "0" & CStr(intR) & strD & strV & Chr(13) & Chr(10)
Case Else
strOutput = strOutput & strQian11wei & CStr(intR) & strD & strV & Chr(13) & Chr(10)
End Select
intR = intR - 32
Loop Until intR <= 0
intDchange = CInt(ArcSin(16 / (CInt(strR))))
For int8 = 1 To intDN
intD = intD - intDchange * 2
Do While intD < 0
intD = intD + 360
Loop
Do While intD > 999
intD = intD - 360
Loop
Select Case intD
Case Is < 10
strOutput = strOutput & strQian11wei & strR & "00" & CStr(intD) & strV & Chr(13) & Chr(10)
Case Is < 100
strOutput = strOutput & strQian11wei & strR & "0" & CStr(intD) & strV & Chr(13) & Chr(10)
Case Else
strOutput = strOutput & strQian11wei & strR & CStr(intD) & strV & Chr(13) & Chr(10)
End Select
Next
For int3 = 1 To intDN
intD2 = intD2 + intDchange * 2
Do While intD2 < 0
intD2 = intD2 + 360
Loop
Do While intD2 > 999
intD2 = intD2 - 360
Loop
Select Case intD2
Case Is < 10
strOutput = strOutput & strQian11wei & strR & "00" & CStr(intD2) & strV & Chr(13) & Chr(10)
Case Is < 100
strOutput = strOutput & strQian11wei & strR & "0" & CStr(intD2) & strV & Chr(13) & Chr(10)
Case Else
strOutput = strOutput & strQian11wei & strR & CStr(intD2) & strV & Chr(13) & Chr(10)
End Select
Next
Next
txtOutput.Text = strOutput
End Sub
Function ArcSin(n As Double) As Double
ArcSin = Atn(n / Sqr(-(n * n) + 1))
End Function
我试过,这个变量的值总是0